package com.mall.business.service;

import java.util.List;
import com.mall.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mall.business.mapper.BusOrderOperateLogMapper;
import com.mall.business.domain.entity.BusOrderOperateLog;
import com.mall.business.service.BusOrderOperateLogService;
import com.mall.common.core.text.Convert;

/**
 * 订单操作日志Service业务层处理
 *
 * @author zhonglin
 * @date 2020-05-24
 */
@Service
public class BusOrderOperateLogService {

  @Autowired
  private BusOrderOperateLogMapper busOrderOperateLogMapper;

  /**
   * 查询订单操作日志
   *
   * @param orderOperateLogId 订单操作日志ID
   *
   * @return 订单操作日志
   */
  public BusOrderOperateLog selectBusOrderOperateLogById(Long orderOperateLogId) {

    return busOrderOperateLogMapper.selectBusOrderOperateLogById(orderOperateLogId);
  }

  /**
   * 查询订单操作日志列表
   *
   * @param busOrderOperateLog 订单操作日志
   *
   * @return 订单操作日志
   */
  public List<BusOrderOperateLog> selectBusOrderOperateLogList(BusOrderOperateLog busOrderOperateLog) {

    return busOrderOperateLogMapper.selectBusOrderOperateLogList(busOrderOperateLog);
  }

  /**
   * 新增订单操作日志
   *
   * @param busOrderOperateLog 订单操作日志
   *
   * @return 结果
   */
  public int insertBusOrderOperateLog(BusOrderOperateLog busOrderOperateLog) {

    busOrderOperateLog.setCreateTime(DateUtils.getNowDate());
    return busOrderOperateLogMapper.insertBusOrderOperateLog(busOrderOperateLog);
  }

  /**
   * 修改订单操作日志
   *
   * @param busOrderOperateLog 订单操作日志
   *
   * @return 结果
   */
  public int updateBusOrderOperateLog(BusOrderOperateLog busOrderOperateLog) {

    busOrderOperateLog.setUpdateTime(DateUtils.getNowDate());
    return busOrderOperateLogMapper.updateBusOrderOperateLog(busOrderOperateLog);
  }

  /**
   * 删除订单操作日志对象
   *
   * @param ids 需要删除的数据ID
   *
   * @return 结果
   */
  public int deleteBusOrderOperateLogByIds(String ids) {

    return busOrderOperateLogMapper.deleteBusOrderOperateLogByIds(Convert.toStrArray(ids));
  }

  /**
   * 删除订单操作日志信息
   *
   * @param orderOperateLogId 订单操作日志ID
   *
   * @return 结果
   */
  public int deleteBusOrderOperateLogById(Long orderOperateLogId) {

    return busOrderOperateLogMapper.deleteBusOrderOperateLogById(orderOperateLogId);
  }

}
